package com.zzyl.nursing.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.Reservation;
import com.zzyl.nursing.dto.ReservationDto;
import com.zzyl.nursing.vo.TimeCountVo;

import java.util.List;

public interface IReservationService extends IService<Reservation> {

    /**
     * 查询预约信息列表
     * @param reservation
     * @return
     */
    List<Reservation> selectReservationList(Reservation reservation);

    /**
     * 新增预约信息
     * @param reservationDto
     * @return
     */
    int insertReservation(ReservationDto reservationDto);

    /**
     * 查询每个时间段剩余预约次数
     * @param time
     * @return
     */
    List<TimeCountVo> countReservationsForTime(Long time);

    /**
     * 获取取消预约数量
     * @param userId
     * @return
     */
    int getCancelledCount(Long userId);


    /**
     * 分页查询预约
     * @param pageNum
     * @param pageSize
     * @param status
     * @return
     */
    TableDataInfo findByPage(int pageNum, int pageSize, Integer status);

    /**
     * 取消预约
     * @param id
     * @return
     */
    int cancelReservation(Long id);
}
